EhsEnforcement.Enforcement (ehs_enforcement v0.1.0)

The Enforcement domain for managing enforcement agencies, cases, notices, and related entities.

This domain uses Ash code interfaces. Generated functions are available for all resources.

Summary

Functions

Calls the approve_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the approve_match action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Batch find or create multiple legislation records.

Batch processing for creating multiple cases efficiently

Batch processing for creating multiple cases efficiently Raises any errors instead of returning them

Batch processing for creating multiple offences efficiently

Batch processing for creating multiple offences efficiently Raises any errors instead of returning them

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.approve_match See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.approve_match, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.bulk_create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.bulk_create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.bulk_create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.bulk_create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.create See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.create, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.destroy See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.destroy, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.destroy See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.destroy, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.destroy See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.destroy, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.destroy See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.destroy, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.destroy See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.destroy, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.destroy See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.destroy, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.flag_for_later See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.flag_for_later, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.get_current See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.get_current, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_case See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_case, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_notice See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_notice, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_reference See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_reference, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.by_date_range See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.by_date_range, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_model_version See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_model_version, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.high_confidence See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.high_confidence, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.high_quality See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.high_quality, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_type See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_type, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_year_range See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_year_range, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_case See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_case, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_legislation See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_legislation, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_notice See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_notice, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.with_fines See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.with_fines, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.recent See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.recent, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.recent See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.recent, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_enrichment See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_enrichment, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_section See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_section, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_user See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_user, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.needs_attention See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.needs_attention, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.pending_reviews See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.pending_reviews, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.refresh See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.refresh, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_offender See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_offender, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_status See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_status, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.reviewed_by_user See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.reviewed_by_user, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.search_title See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.search_title, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.search_description See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.search_description, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.search See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.search, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.skip_match See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.skip_match, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.sync_from_airtable See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.sync_from_airtable, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Agency.update, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.update, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.update_from_scraping See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Case.update_from_scraping, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.update, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.update, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Notice.update, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offence.update, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update_statistics See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update_statistics, returning a boolean. See Ash.can?/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.update See Ash.can/3 for more information

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.update, returning a boolean. See Ash.can?/3 for more information

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Check which notice regulator_ids already exist in the database.

Clear all cached results. Useful when data is updated.

Cached count functions for dashboard metrics and pagination.

Monitored version of count_cases! that logs slow queries.

Monitored version of count_notices! that logs slow queries.

Monitored version of count_offenders! that logs slow queries.

Calls the create action on EhsEnforcement.Enforcement.Agency.

Calls the create action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.Case.

Calls the create action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.Enrichment.

Calls the create action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.Legislation.

Calls the create action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.Notice.

Calls the create action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.Offence.

Calls the create action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.Offender.

Calls the create action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the create action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Calls the create action on EhsEnforcement.Enforcement.EnrichmentValidation.

Calls the create action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Calls the destroy action on EhsEnforcement.Enforcement.Case.

Calls the destroy action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Calls the destroy action on EhsEnforcement.Enforcement.Enrichment.

Calls the destroy action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Calls the destroy action on EhsEnforcement.Enforcement.Legislation.

Calls the destroy action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Calls the destroy action on EhsEnforcement.Enforcement.Notice.

Calls the destroy action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Calls the destroy action on EhsEnforcement.Enforcement.Offence.

Calls the destroy action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the destroy action on EhsEnforcement.Enforcement.EnrichmentValidation.

Calls the destroy action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Find offenders with duplicate company registration numbers.

Find or create legislation with deduplication logic.

Calls the flag_for_later action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the flag_for_later action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Creates a form for the approve_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Batch processing for creating multiple cases efficiently

Batch processing for creating multiple offences efficiently

Creates a form for the create action on EhsEnforcement.Enforcement.Agency.

Creates a form for the create action on EhsEnforcement.Enforcement.Case.

Creates a form for the create action on EhsEnforcement.Enforcement.Enrichment.

Creates a form for the create action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the create action on EhsEnforcement.Enforcement.Notice.

Creates a form for the create action on EhsEnforcement.Enforcement.Offence.

Creates a form for the create action on EhsEnforcement.Enforcement.Offender.

Creates a form for the create action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the create action on EhsEnforcement.Enforcement.EnrichmentValidation.

Creates a form for the destroy action on EhsEnforcement.Enforcement.Case.

Creates a form for the destroy action on EhsEnforcement.Enforcement.Enrichment.

Creates a form for the destroy action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the destroy action on EhsEnforcement.Enforcement.Notice.

Creates a form for the destroy action on EhsEnforcement.Enforcement.Offence.

Creates a form for the destroy action on EhsEnforcement.Enforcement.EnrichmentValidation.

Creates a form for the flag_for_later action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the read action on EhsEnforcement.Enforcement.Agency.

Creates a form for the read action on EhsEnforcement.Enforcement.Agency.

Creates a form for the read action on EhsEnforcement.Enforcement.Case.

Get the most recent metrics for each time period

Creates a form for the read action on EhsEnforcement.Enforcement.Enrichment.

Find enrichment for a specific case

Find enrichment for a specific notice

Creates a form for the read action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the read action on EhsEnforcement.Enforcement.Notice.

Creates a form for the read action on EhsEnforcement.Enforcement.Offence.

Creates a form for the by_reference action on EhsEnforcement.Enforcement.Offence.

Creates a form for the read action on EhsEnforcement.Enforcement.Offender.

Creates a form for the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Creates a form for the read action on EhsEnforcement.Enforcement.Agency.

Creates a form for the read action on EhsEnforcement.Enforcement.Case.

Creates a form for the by_date_range action on EhsEnforcement.Enforcement.Case.

Creates a form for the read action on EhsEnforcement.Enforcement.Enrichment.

Find enrichments generated by a specific AI model version

Get enrichments with high confidence scores (all sections > 0.8)

Get validations with 4-5 star ratings

Creates a form for the read action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the by_type action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the by_year_range action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the read action on EhsEnforcement.Enforcement.Notice.

Creates a form for the read action on EhsEnforcement.Enforcement.Offence.

Creates a form for the by_case action on EhsEnforcement.Enforcement.Offence.

Creates a form for the by_legislation action on EhsEnforcement.Enforcement.Offence.

Creates a form for the by_notice action on EhsEnforcement.Enforcement.Offence.

Creates a form for the with_fines action on EhsEnforcement.Enforcement.Offence.

Creates a form for the read action on EhsEnforcement.Enforcement.Offender.

Get recently generated enrichments (last 30 days)

Get recent validations (last 30 days)

Creates a form for the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Get all validations for a specific enrichment

Get all validations for a specific section type

Get all validations performed by a specific user

Get validations with low ratings (1-2 stars) that need review

Creates a form for the pending_reviews action on EhsEnforcement.Enforcement.OffenderMatchReview.

Refresh metrics for a specific filter combination

Creates a form for the by_offender action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the by_status action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the reviewed_by_user action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the search_title action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the search_description action on EhsEnforcement.Enforcement.Offence.

Creates a form for the search action on EhsEnforcement.Enforcement.Offender.

Creates a form for the skip_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Creates a form for the sync_from_airtable action on EhsEnforcement.Enforcement.Case.

Creates a form for the update action on EhsEnforcement.Enforcement.Agency.

Creates a form for the update action on EhsEnforcement.Enforcement.Case.

Creates a form for the update_from_scraping action on EhsEnforcement.Enforcement.Case.

Creates a form for the update action on EhsEnforcement.Enforcement.Enrichment.

Creates a form for the update action on EhsEnforcement.Enforcement.Legislation.

Creates a form for the update action on EhsEnforcement.Enforcement.Notice.

Creates a form for the update action on EhsEnforcement.Enforcement.Offence.

Creates a form for the update action on EhsEnforcement.Enforcement.Offender.

Creates a form for the update_statistics action on EhsEnforcement.Enforcement.Offender.

Creates a form for the update action on EhsEnforcement.Enforcement.EnrichmentValidation.

Perform fuzzy search across cases using pg_trgm trigram similarity.

Perform fuzzy search across notices using pg_trgm trigram similarity.

Perform fuzzy search across offenders using pg_trgm trigram similarity.

Calls the read action on EhsEnforcement.Enforcement.Agency.

Calls the read action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Agency.

Calls the read action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Case.

Calls the read action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Get the most recent metrics for each time period

Get the most recent metrics for each time period Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Enrichment.

Calls the read action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Find enrichment for a specific case Raises any errors instead of returning them

Find enrichment for a specific notice Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Legislation.

Calls the read action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Get legislation statistics for monitoring duplicate prevention.

Calls the read action on EhsEnforcement.Enforcement.Notice.

Calls the read action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Offence.

Calls the read action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the by_reference action on EhsEnforcement.Enforcement.Offence.

Calls the by_reference action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Offender.

Calls the read action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Get query performance statistics for monitoring dashboards. This could be extended to track metrics in ETS/database for reporting.

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Initialize the cache table. Called during application startup.

Calls the read action on EhsEnforcement.Enforcement.Agency.

Calls the read action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Case.

Calls the read action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Calls the by_date_range action on EhsEnforcement.Enforcement.Case.

Calls the by_date_range action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Cached version of list_cases_with_filters! for frequently used filter combinations.

Monitored version of list_cases_with_filters! that logs slow queries.

Calls the read action on EhsEnforcement.Enforcement.Enrichment.

Calls the read action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Find enrichments generated by a specific AI model version

Find enrichments generated by a specific AI model version Raises any errors instead of returning them

Get enrichments with high confidence scores (all sections > 0.8)

Get enrichments with high confidence scores (all sections > 0.8) Raises any errors instead of returning them

Get validations with 4-5 star ratings

Get validations with 4-5 star ratings Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Legislation.

Calls the read action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Calls the by_type action on EhsEnforcement.Enforcement.Legislation.

Calls the by_type action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Calls the by_year_range action on EhsEnforcement.Enforcement.Legislation.

Calls the by_year_range action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Notice.

Calls the read action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Cached version of list_notices_with_filters! for frequently used filter combinations.

Monitored version of list_notices_with_filters! that logs slow queries.

Calls the read action on EhsEnforcement.Enforcement.Offence.

Calls the read action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the by_case action on EhsEnforcement.Enforcement.Offence.

Calls the by_case action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the by_legislation action on EhsEnforcement.Enforcement.Offence.

Calls the by_legislation action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the by_notice action on EhsEnforcement.Enforcement.Offence.

Calls the by_notice action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the with_fines action on EhsEnforcement.Enforcement.Offence.

Calls the with_fines action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.Offender.

Calls the read action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Cached version of list_offenders_with_filters! for frequently used filter combinations.

Monitored version of list_offenders_with_filters! that logs slow queries.

Get recently generated enrichments (last 30 days)

Get recently generated enrichments (last 30 days) Raises any errors instead of returning them

Get recent validations (last 30 days)

Get recent validations (last 30 days) Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Get all validations for a specific enrichment Raises any errors instead of returning them

Get all validations for a specific section type

Get all validations for a specific section type Raises any errors instead of returning them

Get all validations performed by a specific user

Get all validations performed by a specific user Raises any errors instead of returning them

Get validations with low ratings (1-2 stars) that need review

Get validations with low ratings (1-2 stars) that need review Raises any errors instead of returning them

page(page, request) deprecated

Calls the pending_reviews action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the pending_reviews action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Preview what a merge operation would do before executing it.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Returns the query corresponding to the action.

Refresh metrics for a specific filter combination

Refresh metrics for a specific filter combination Raises any errors instead of returning them

Calls the by_offender action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the by_offender action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Calls the by_status action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the by_status action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Calls the reviewed_by_user action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the reviewed_by_user action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Search for existing legislation by title with fuzzy matching.

Calls the search_title action on EhsEnforcement.Enforcement.Legislation.

Calls the search_title action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Calls the search_description action on EhsEnforcement.Enforcement.Offence.

Calls the search_description action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the search action on EhsEnforcement.Enforcement.Offender.

Calls the search action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Calls the skip_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Calls the skip_match action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Execute the merge operation to combine duplicate offenders.

Calls the sync_from_airtable action on EhsEnforcement.Enforcement.Case.

Calls the sync_from_airtable action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.Agency.

Calls the update action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.Case.

Calls the update action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Calls the update_from_scraping action on EhsEnforcement.Enforcement.Case.

Calls the update_from_scraping action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.Enrichment.

Calls the update action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.Legislation.

Calls the update action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.Notice.

Calls the update action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.Offence.

Calls the update action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.Offender.

Calls the update action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Calls the update_statistics action on EhsEnforcement.Enforcement.Offender.

Calls the update_statistics action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Calls the update action on EhsEnforcement.Enforcement.EnrichmentValidation.

Calls the update action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Functions

aggregate(query, aggregate_or_aggregates, opts \\ [])

This function is deprecated. Use `Ash.aggregate/3` instead.

aggregate!(query, aggregate_or_aggregates, opts \\ [])

This function is deprecated. Use `Ash.aggregate!/3` instead.

approve_match(record, reviewed_by_id, selected_company_number, params \\ nil, opts \\ nil)

Calls the approve_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Arguments

  • reviewed_by_id
  • selected_company_number - The company registration number selected by admin (only set when status = approved)

Inputs

  • review_notes - Optional notes from admin about the review decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

approve_match!(record, reviewed_by_id, selected_company_number, params \\ nil, opts \\ nil)

Calls the approve_match action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Arguments

  • reviewed_by_id
  • selected_company_number - The company registration number selected by admin (only set when status = approved)

Inputs

  • review_notes - Optional notes from admin about the review decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

avg(query, field, opts \\ [])

This function is deprecated. Use `Ash.avg/3` instead.

avg!(query, field, opts \\ [])

This function is deprecated. Use `Ash.avg!/3` instead.

batch_find_or_create_legislation(legislation_data_list)

@spec batch_find_or_create_legislation([map()]) :: {:ok, map()} | {:error, term()}

Batch find or create multiple legislation records.

Useful for processing multiple breaches or offences at once. Returns a map of original titles to legislation records.

bulk_create(inputs, resource, action, opts \\ [])

This function is deprecated. Use `Ash.bulk_create/4` instead.

bulk_create!(inputs, resource, action, opts \\ [])

This function is deprecated. Use `Ash.bulk_create!/4` instead.

bulk_create_cases(params \\ nil, opts \\ nil)

Batch processing for creating multiple cases efficiently

Inputs

  • batch_size
  • cases_data

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

bulk_create_cases!(params \\ nil, opts \\ nil)

Batch processing for creating multiple cases efficiently Raises any errors instead of returning them

Inputs

  • batch_size
  • cases_data

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

bulk_create_offences(params \\ nil, opts \\ nil)

Batch processing for creating multiple offences efficiently

Inputs

  • case_id
  • notice_id
  • offences_data

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

bulk_create_offences!(params \\ nil, opts \\ nil)

Batch processing for creating multiple offences efficiently Raises any errors instead of returning them

Inputs

  • case_id
  • notice_id
  • offences_data

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

bulk_destroy(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_destroy/4` instead.

bulk_destroy!(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_destroy!/4` instead.

bulk_update(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_update/4` instead.

bulk_update!(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_update!/4` instead.

calculate(resource, calculation, opts \\ [])

This function is deprecated. Use `Ash.calculate/3` instead.

calculate!(resource, calculation, opts \\ [])

This function is deprecated. Use `Ash.calculate!/3` instead.

can(action_or_query_or_changeset, actor, opts \\ [])

This function is deprecated. Use `Ash.can/3` instead.
@spec can(
  action_or_query_or_changeset ::
    Ash.Query.t()
    | Ash.Changeset.t()
    | {Ash.Resource.t(), atom() | Ash.Resource.Actions.action()},
  actor :: term(),
  opts :: Keyword.t()
) :: {:ok, boolean() | :maybe} | {:error, term()}

can?(query_or_changeset_or_action, actor, opts \\ [])

This function is deprecated. Use `Ash.can?/3` instead.
@spec can?(
  query_or_changeset_or_action ::
    Ash.Query.t()
    | Ash.Changeset.t()
    | {Ash.Resource.t(), atom() | Ash.Resource.Actions.action()},
  actor :: term(),
  opts :: Keyword.t()
) :: boolean() | no_return()

can_approve_match(actor, record, reviewed_by_id, selected_company_number, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.approve_match See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_approve_match?(actor, record, reviewed_by_id, selected_company_number, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.approve_match, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_bulk_create_cases(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.bulk_create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_bulk_create_cases?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.bulk_create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_bulk_create_offences(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.bulk_create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_bulk_create_offences?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.bulk_create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_agency(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_agency?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_case(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_case?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_enrichment(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_enrichment?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_legislation(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_legislation?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_notice(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_notice?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_offence(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_offence?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_offender(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_offender?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_review(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_review?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_validation(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.create See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_create_validation?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.create, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_case(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.destroy See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_case?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.destroy, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_enrichment(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.destroy See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_enrichment?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.destroy, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_legislation(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.destroy See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_legislation?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.destroy, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_notice(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.destroy See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_notice?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.destroy, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_offence(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.destroy See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_offence?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.destroy, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_validation(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.destroy See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_destroy_validation?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.destroy, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_flag_for_later(actor, record, reviewed_by_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.flag_for_later See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_flag_for_later?(actor, record, reviewed_by_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.flag_for_later, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_agency(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_agency?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_agency_by_code(actor, code, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_agency_by_code?(actor, code, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_case(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_case?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_current_metrics(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.get_current See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_current_metrics?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.get_current, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_enrichment(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_enrichment?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_enrichment_by_case(actor, case_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_case See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_enrichment_by_case?(actor, case_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_case, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_enrichment_by_notice(actor, notice_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_notice See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_enrichment_by_notice?(actor, notice_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_notice, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_legislation(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_legislation?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_notice(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_notice?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_offence(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_offence?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_offence_by_reference(actor, offence_reference, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_reference See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_offence_by_reference?(actor, offence_reference, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_reference, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_offender(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_offender?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_review(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_review?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_validation(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_get_validation?(actor, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_agencies(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_agencies?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_cases(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_cases?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_cases_by_date_range(actor, from_date, to_date, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.by_date_range See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_cases_by_date_range?(actor, from_date, to_date, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.by_date_range, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_enrichments(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_enrichments?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_enrichments_by_model(actor, model_version, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_model_version See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_enrichments_by_model?(actor, model_version, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.by_model_version, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_high_confidence_enrichments(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.high_confidence See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_high_confidence_enrichments?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.high_confidence, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_high_quality_validations(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.high_quality See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_high_quality_validations?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.high_quality, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_legislation(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_legislation?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_legislation_by_type(actor, legislation_type, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_type See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_legislation_by_type?(actor, legislation_type, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_type, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_legislation_by_year_range(actor, start_year, end_year, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_year_range See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_legislation_by_year_range?(actor, start_year, end_year, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.by_year_range, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_notices(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_notices?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_by_case(actor, case_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_case See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_by_case?(actor, case_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_case, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_by_legislation(actor, legislation_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_legislation See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_by_legislation?(actor, legislation_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_legislation, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_by_notice(actor, notice_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_notice See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_by_notice?(actor, notice_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.by_notice, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_with_fines(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.with_fines See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offences_with_fines?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.with_fines, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offenders(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_offenders?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_recent_enrichments(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.recent See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_recent_enrichments?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.recent, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_recent_validations(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.recent See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_recent_validations?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.recent, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_reviews(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_reviews?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.read, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_by_enrichment(actor, enrichment_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_enrichment See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_by_enrichment?(actor, enrichment_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_enrichment, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_by_section(actor, section, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_section See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_by_section?(actor, section, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_section, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_by_user(actor, user_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_user See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_by_user?(actor, user_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.by_user, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_needing_attention(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.needs_attention See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_list_validations_needing_attention?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.needs_attention, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_pending_reviews(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.pending_reviews See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_pending_reviews?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.pending_reviews, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_refresh_metrics(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.refresh See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_refresh_metrics?(actor, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Metrics.refresh, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_reviews_by_offender(actor, offender_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_offender See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_reviews_by_offender?(actor, offender_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_offender, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_reviews_by_status(actor, status, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_status See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_reviews_by_status?(actor, status, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.by_status, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_reviews_by_user(actor, user_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.reviewed_by_user See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_reviews_by_user?(actor, user_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.reviewed_by_user, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_search_legislation_title(actor, search_term, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.search_title See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_search_legislation_title?(actor, search_term, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.search_title, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_search_offence_description(actor, search_term, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.search_description See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_search_offence_description?(actor, search_term, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.search_description, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_search_offenders(actor, query, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.search See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_search_offenders?(actor, query, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.search, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_skip_match(actor, record, reviewed_by_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.skip_match See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_skip_match?(actor, record, reviewed_by_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.OffenderMatchReview.skip_match, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_sync_case_from_airtable(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.sync_from_airtable See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_sync_case_from_airtable?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.sync_from_airtable, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_agency(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_agency?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Agency.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_case(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_case?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_case_from_scraping(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.update_from_scraping See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_case_from_scraping?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Case.update_from_scraping, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_enrichment(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_enrichment?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Enrichment.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_legislation(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_legislation?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Legislation.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_notice(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_notice?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Notice.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_offence(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_offence?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offence.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_offender(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_offender?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_offender_statistics(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update_statistics See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_offender_statistics?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.Offender.update_statistics, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_validation(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.update See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

can_update_validation?(actor, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for EhsEnforcement.Enforcement.EnrichmentValidation.update, returning a boolean. See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is true.
  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.
  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.
  • :reuse_values? (boolean/0) - Whether or not loaded data like aggregates, calculations and relationships should be checked in memory if possible, instead of querying. No effect if pre_flight? is false. The default value is false.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Will overwrite any actor, tenant or context provided. See Ash.Context for more.
  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.
  • :data - The record or records specifically attempting to be acted upon.
  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization
  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.
  • :base_query (term/0) - A base query on which to apply an generated filters
  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.
  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.
  • :atomic_changeset (term/0) - A base query on which to apply an generated filters
  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.
  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

change_case_for_airtable_sync(case_record, attrs \\ %{})

change_case_for_scraping(case_record, attrs \\ %{})

changeset_to_approve_match(record, reviewed_by_id, selected_company_number, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_bulk_create_cases(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_bulk_create_offences(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_agency(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_case(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_enrichment(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_legislation(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_notice(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_offence(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_offender(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_review(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_create_validation(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_destroy_case(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_destroy_enrichment(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_destroy_legislation(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_destroy_notice(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_destroy_offence(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_destroy_validation(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_flag_for_later(record, reviewed_by_id, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_refresh_metrics(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_skip_match(record, reviewed_by_id, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_sync_case_from_airtable(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_agency(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_case(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_case_from_scraping(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_enrichment(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_legislation(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_notice(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_offence(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_offender(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_offender_statistics(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_update_validation(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

check_existing_notice_regulator_ids(regulator_ids, agency_code, actor \\ nil)

Check which notice regulator_ids already exist in the database.

Used for pre-filtering during EA enforcement notice scraping to skip existing records and only process new ones.

Parameters

  • regulator_ids - List of regulator_id strings to check
  • agency_code - Agency code atom (e.g., :environment_agency)
  • actor - Optional actor for authorization (default: nil)

Returns

Map with existing and new regulator_id lists plus counts:

  • :existing - List of regulator_ids that already exist
  • :new - List of regulator_ids that don't exist yet
  • :total - Total count of regulator_ids checked
  • :existing_count - Count of existing records
  • :new_count - Count of new records

Examples

iex> check_existing_notice_regulator_ids(["EA-123", "EA-456", "EA-789"], :environment_agency)
%{
  existing: ["EA-123", "EA-456"],
  new: ["EA-789"],
  total: 3,
  existing_count: 2,
  new_count: 1
}

clear_cache()

Clear all cached results. Useful when data is updated.

count(query, opts \\ [])

This function is deprecated. Use `Ash.count/2` instead.

count!(query, opts \\ [])

This function is deprecated. Use `Ash.count!/2` instead.

count_cases!(opts \\ [])

count_cases_cached!(opts \\ [])

Cached count functions for dashboard metrics and pagination.

count_cases_monitored!(opts \\ [])

Monitored version of count_cases! that logs slow queries.

count_legislation!(opts \\ [])

count_notices!(opts \\ [])

count_notices_cached!(opts \\ [])

count_notices_monitored!(opts \\ [])

Monitored version of count_notices! that logs slow queries.

count_offenders!(opts \\ [])

count_offenders_cached!(opts \\ [])

count_offenders_monitored!(opts \\ [])

Monitored version of count_offenders! that logs slow queries.

create(changeset, opts \\ [])

This function is deprecated. Use `Ash.create/2` instead.

create!(changeset, opts \\ [])

This function is deprecated. Use `Ash.create!/2` instead.

create_agency(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Agency.

Inputs

  • code
  • enabled
  • name
  • base_url

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_agency!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Inputs

  • code
  • enabled
  • name
  • base_url

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_case(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Case.

Inputs

  • last_synced_at
  • ea_total_violation_count - Number of violations in EA case
  • environmental_receptor - Environmental receptor affected: 'land', 'water', 'air'
  • ea_event_reference - EA event ID (e.g., '205107')
  • offence_action_type
  • regulator_id - Unique ID from agency system (EA: ea_record_id, HSE: regulator case ID)
  • offence_result
  • offence_costs
  • offence_breaches - Description of regulation breaches/violations
  • offence_hearing_date
  • agency_id
  • agency_code
  • regulator_url
  • is_ea_multi_violation - True if EA case has multiple distinct violations
  • environmental_impact - Environmental impact level: 'none', 'minor', 'major'
  • url
  • offence_action_date
  • regulator_function
  • case_reference - Agency's case reference number (e.g., EA 'Case Reference' field)
  • related_cases
  • offender_attrs
  • offender_id
  • offence_fine

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_case!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Inputs

  • last_synced_at
  • ea_total_violation_count - Number of violations in EA case
  • environmental_receptor - Environmental receptor affected: 'land', 'water', 'air'
  • ea_event_reference - EA event ID (e.g., '205107')
  • offence_action_type
  • regulator_id - Unique ID from agency system (EA: ea_record_id, HSE: regulator case ID)
  • offence_result
  • offence_costs
  • offence_breaches - Description of regulation breaches/violations
  • offence_hearing_date
  • agency_id
  • agency_code
  • regulator_url
  • is_ea_multi_violation - True if EA case has multiple distinct violations
  • environmental_impact - Environmental impact level: 'none', 'minor', 'major'
  • url
  • offence_action_date
  • regulator_function
  • case_reference - Agency's case reference number (e.g., EA 'Case Reference' field)
  • related_cases
  • offender_attrs
  • offender_id
  • offence_fine

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_enrichment(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Enrichment.

Inputs

  • case_id
  • notice_id
  • model_version - AI model version used (e.g., 'gpt-4-turbo', 'claude-sonnet-3.5')
  • generated_at - Timestamp when enrichment was generated
  • regulation_links - AI-identified regulation references extracted from breach descriptions. Each entry contains: {act, section, relevance_score, summary}
  • benchmark_analysis - Industry benchmark comparisons.
  • For Cases: fine amount percentiles, average fines for similar violations
  • For Notices: compliance timelines, notice escalation patterns
  • confidence_scores - Confidence scores (0.0-1.0) for each AI-generated section: {regulation_links: 0.95, benchmark_accuracy: 0.87, pattern_detection: 0.82, ...}
  • pattern_detection - Historical pattern analysis including:
  • Similar cases/notices count
  • Trend analysis (increasing/decreasing enforcement)
  • Notable precedents
  • Repeat offender patterns
  • layperson_summary - Plain language summary (Grade 8-10 reading level) for non-technical users
  • professional_summary - Technical summary for compliance officers and legal professionals
  • auto_tags - AI-generated categorization tags (e.g., 'construction', 'fatal-accident', 'repeat-offender')
  • processing_time_ms - Time taken to generate enrichment (milliseconds)

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_enrichment!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Inputs

  • case_id
  • notice_id
  • model_version - AI model version used (e.g., 'gpt-4-turbo', 'claude-sonnet-3.5')
  • generated_at - Timestamp when enrichment was generated
  • regulation_links - AI-identified regulation references extracted from breach descriptions. Each entry contains: {act, section, relevance_score, summary}
  • benchmark_analysis - Industry benchmark comparisons.
  • For Cases: fine amount percentiles, average fines for similar violations
  • For Notices: compliance timelines, notice escalation patterns
  • confidence_scores - Confidence scores (0.0-1.0) for each AI-generated section: {regulation_links: 0.95, benchmark_accuracy: 0.87, pattern_detection: 0.82, ...}
  • pattern_detection - Historical pattern analysis including:
  • Similar cases/notices count
  • Trend analysis (increasing/decreasing enforcement)
  • Notable precedents
  • Repeat offender patterns
  • layperson_summary - Plain language summary (Grade 8-10 reading level) for non-technical users
  • professional_summary - Technical summary for compliance officers and legal professionals
  • auto_tags - AI-generated categorization tags (e.g., 'construction', 'fatal-accident', 'repeat-offender')
  • processing_time_ms - Time taken to generate enrichment (milliseconds)

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_legislation(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Legislation.

Inputs

  • legislation_title - Full title of the legislation (e.g., 'Health and Safety at Work etc. Act')
  • legislation_type - Type of legislation
  • legislation_year - Year the legislation was enacted (e.g., 1974)
  • legislation_number - Official number/chapter of the legislation (e.g., 33)

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_legislation!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Inputs

  • legislation_title - Full title of the legislation (e.g., 'Health and Safety at Work etc. Act')
  • legislation_type - Type of legislation
  • legislation_year - Year the legislation was enacted (e.g., 1974)
  • legislation_number - Official number/chapter of the legislation (e.g., 33)

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_notice(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Notice.

Inputs

  • notice_body
  • airtable_id
  • last_synced_at
  • environmental_receptor
  • operative_date
  • offence_action_type
  • regulator_id
  • legal_section
  • notice_date
  • offence_breaches - Description of regulation breaches/violations
  • agency_id
  • agency_code
  • environmental_impact
  • legal_act
  • url
  • regulator_event_reference
  • offence_action_date
  • regulator_function
  • offender_attrs
  • offender_id
  • compliance_date
  • regulator_ref_number

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_notice!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Inputs

  • notice_body
  • airtable_id
  • last_synced_at
  • environmental_receptor
  • operative_date
  • offence_action_type
  • regulator_id
  • legal_section
  • notice_date
  • offence_breaches - Description of regulation breaches/violations
  • agency_id
  • agency_code
  • environmental_impact
  • legal_act
  • url
  • regulator_event_reference
  • offence_action_date
  • regulator_function
  • offender_attrs
  • offender_id
  • compliance_date
  • regulator_ref_number

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_offence(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Offence.

Inputs

  • fine - Fine amount for this specific offence
  • offence_description - Description of the specific breach or violation
  • sequence_number - Order/sequence within parent case (for multi-violation EA cases)
  • legislation_id
  • legislation_part - Specific part, section, or regulation of the legislation (e.g., 'Section 33', 'Regulation 4')
  • case_id
  • notice_id
  • offence_reference - External reference for the offence (e.g., EA case reference 'SW/A/2010/2051079/01')

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_offence!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Inputs

  • fine - Fine amount for this specific offence
  • offence_description - Description of the specific breach or violation
  • sequence_number - Order/sequence within parent case (for multi-violation EA cases)
  • legislation_id
  • legislation_part - Specific part, section, or regulation of the legislation (e.g., 'Section 33', 'Regulation 4')
  • case_id
  • notice_id
  • offence_reference - External reference for the offence (e.g., EA case reference 'SW/A/2010/2051079/01')

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_offender(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Offender.

Inputs

  • last_seen_date
  • local_authority
  • industry_sectors - EA detailed industry sectors (e.g., ['Manufacturing - General Engineering'])
  • town - Town from EA structured address (e.g., 'BARNSLEY')
  • county - County from EA structured address (e.g., 'SOUTH YORKSHIRE')
  • total_notices
  • main_activity
  • country
  • industry
  • company_registration_number - Companies House registration number (e.g., '04622955')
  • total_fines
  • first_seen_date
  • name
  • postcode
  • business_type
  • agencies
  • sic_code
  • total_cases
  • address

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_offender!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Inputs

  • last_seen_date
  • local_authority
  • industry_sectors - EA detailed industry sectors (e.g., ['Manufacturing - General Engineering'])
  • town - Town from EA structured address (e.g., 'BARNSLEY')
  • county - County from EA structured address (e.g., 'SOUTH YORKSHIRE')
  • total_notices
  • main_activity
  • country
  • industry
  • company_registration_number - Companies House registration number (e.g., '04622955')
  • total_fines
  • first_seen_date
  • name
  • postcode
  • business_type
  • agencies
  • sic_code
  • total_cases
  • address

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_review(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.OffenderMatchReview.

Inputs

  • status
  • offender_id
  • confidence_score - Highest similarity score from candidate companies (0.0-1.0)
  • searched_at
  • candidate_companies - Array of top 3 Companies House candidate matches. Each entry contains: company_number, company_name, company_status, company_type, address, similarity_score

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_review!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Inputs

  • status
  • offender_id
  • confidence_score - Highest similarity score from candidate companies (0.0-1.0)
  • searched_at
  • candidate_companies - Array of top 3 Companies House candidate matches. Each entry contains: company_number, company_name, company_status, company_type, address, similarity_score

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_validation(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.EnrichmentValidation.

Inputs

  • section - Which enrichment section is being validated
  • user_id
  • enrichment_id
  • validated_at - When this validation was performed
  • rating - Accuracy rating (1-5 stars)
  • corrections - Optional correction suggestions or detailed feedback from professional
  • validation_notes - Internal notes about validation context (e.g., 'Validated during QA review')

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_validation!(params \\ nil, opts \\ nil)

Calls the create action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Inputs

  • section - Which enrichment section is being validated
  • user_id
  • enrichment_id
  • validated_at - When this validation was performed
  • rating - Accuracy rating (1-5 stars)
  • corrections - Optional correction suggestions or detailed feedback from professional
  • validation_notes - Internal notes about validation context (e.g., 'Validated during QA review')

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

default_short_name()

destroy(record, opts \\ [])

This function is deprecated. Use `Ash.destroy/2` instead.

destroy!(record, opts \\ [])

This function is deprecated. Use `Ash.destroy!/2` instead.

destroy_case(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Case.

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_case!(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_enrichment(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_enrichment!(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_legislation(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Legislation.

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_legislation!(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_notice(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Notice.

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_notice!(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_offence(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Offence.

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_offence!(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_validation(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

destroy_validation!(record, params \\ nil, opts \\ nil)

Calls the destroy action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Options

  • :return_destroyed? (boolean/0) - If true, the destroyed record is included in the return result, e.g {:ok, destroyed} or {:ok, destroyed, notifications} The default value is false.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_destroy, if a query, list, or stream of inputs is provided.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is :atomic.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

exists(query, opts \\ [])

This function is deprecated. Use `Ash.exists/2` instead.

exists?(query, opts \\ [])

This function is deprecated. Use `Ash.exists?/2` instead.

find_duplicate_offenders_by_company_number()

Find offenders with duplicate company registration numbers.

Returns grouped duplicates by company registration number.

Returns

List of maps with:

  • :company_number - The duplicated company registration number
  • :offenders - List of offender records with this number
  • :count - Number of duplicate records

Examples

iex> find_duplicate_offenders_by_company_number()
{:ok, [
  %{company_number: "01999508", offenders: [offender1, offender2], count: 2},
  %{company_number: "03353423", offenders: [offender3, offender4], count: 2}
]}

find_or_create_legislation(title, year \\ nil, number \\ nil, type \\ nil)

@spec find_or_create_legislation(
  String.t(),
  integer() | nil,
  integer() | nil,
  atom() | nil
) ::
  {:ok, struct()} | {:error, term()}

Find or create legislation with deduplication logic.

This function prevents duplicate legislation records by:

  1. Normalizing the title
  2. Searching for exact matches first
  3. Using fuzzy matching for similar titles
  4. Creating new records only when no match exists

Works for both HSE and EA legislation processing.

Parameters

  • title - The legislation title (required)
  • year - The year enacted (optional, extracted from title if not provided)
  • number - The legislation number (optional)
  • type - The legislation type (optional, determined from title if not provided)

Examples

iex> find_or_create_legislation("Health and Safety at Work Act 1974", 1974, 37)
{:ok, %Legislation{legislation_title: "Health and Safety at Work etc. Act", ...}}

iex> find_or_create_legislation("COSHH REGULATIONS 2002")
{:ok, %Legislation{legislation_title: "Control of Substances Hazardous to Health Regulations", ...}}

first(query, field, opts \\ [])

This function is deprecated. Use `Ash.first/3` instead.

first!(query, field, opts \\ [])

This function is deprecated. Use `Ash.first!/3` instead.

flag_for_later(record, reviewed_by_id, params \\ nil, opts \\ nil)

Calls the flag_for_later action on EhsEnforcement.Enforcement.OffenderMatchReview.

Arguments

  • reviewed_by_id

Inputs

  • review_notes - Optional notes from admin about the review decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

flag_for_later!(record, reviewed_by_id, params \\ nil, opts \\ nil)

Calls the flag_for_later action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Arguments

  • reviewed_by_id

Inputs

  • review_notes - Optional notes from admin about the review decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

form_to_approve_match(record, form_opts \\ [])

Creates a form for the approve_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_bulk_create_cases(form_opts \\ [])

Batch processing for creating multiple cases efficiently

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_bulk_create_offences(form_opts \\ [])

Batch processing for creating multiple offences efficiently

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_agency(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.Agency.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_case(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_enrichment(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_legislation(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_notice(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.Notice.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_offence(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_offender(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.Offender.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_review(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_create_validation(form_opts \\ [])

Creates a form for the create action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_destroy_case(record, form_opts \\ [])

Creates a form for the destroy action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_destroy_enrichment(record, form_opts \\ [])

Creates a form for the destroy action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_destroy_legislation(record, form_opts \\ [])

Creates a form for the destroy action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_destroy_notice(record, form_opts \\ [])

Creates a form for the destroy action on EhsEnforcement.Enforcement.Notice.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_destroy_offence(record, form_opts \\ [])

Creates a form for the destroy action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_destroy_validation(record, form_opts \\ [])

Creates a form for the destroy action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_flag_for_later(record, form_opts \\ [])

Creates a form for the flag_for_later action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_agency(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Agency.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_agency_by_code(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Agency.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_case(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_current_metrics(form_opts \\ [])

Get the most recent metrics for each time period

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_enrichment(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_enrichment_by_case(form_opts \\ [])

Find enrichment for a specific case

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_enrichment_by_notice(form_opts \\ [])

Find enrichment for a specific notice

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_legislation(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_notice(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Notice.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_offence(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_offence_by_reference(form_opts \\ [])

Creates a form for the by_reference action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_offender(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Offender.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_review(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_get_validation(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_agencies(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Agency.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_cases(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_cases_by_date_range(form_opts \\ [])

Creates a form for the by_date_range action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_enrichments(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_enrichments_by_model(form_opts \\ [])

Find enrichments generated by a specific AI model version

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_high_confidence_enrichments(form_opts \\ [])

Get enrichments with high confidence scores (all sections > 0.8)

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_high_quality_validations(form_opts \\ [])

Get validations with 4-5 star ratings

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_legislation(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_legislation_by_type(form_opts \\ [])

Creates a form for the by_type action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_legislation_by_year_range(form_opts \\ [])

Creates a form for the by_year_range action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_notices(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Notice.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_offences(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_offences_by_case(form_opts \\ [])

Creates a form for the by_case action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_offences_by_legislation(form_opts \\ [])

Creates a form for the by_legislation action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_offences_by_notice(form_opts \\ [])

Creates a form for the by_notice action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_offences_with_fines(form_opts \\ [])

Creates a form for the with_fines action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_offenders(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.Offender.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_recent_enrichments(form_opts \\ [])

Get recently generated enrichments (last 30 days)

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_recent_validations(form_opts \\ [])

Get recent validations (last 30 days)

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_reviews(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_validations(form_opts \\ [])

Creates a form for the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_validations_by_enrichment(form_opts \\ [])

Get all validations for a specific enrichment

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_validations_by_section(form_opts \\ [])

Get all validations for a specific section type

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_validations_by_user(form_opts \\ [])

Get all validations performed by a specific user

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_list_validations_needing_attention(form_opts \\ [])

Get validations with low ratings (1-2 stars) that need review

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_pending_reviews(form_opts \\ [])

Creates a form for the pending_reviews action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_refresh_metrics(form_opts \\ [])

Refresh metrics for a specific filter combination

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_reviews_by_offender(form_opts \\ [])

Creates a form for the by_offender action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_reviews_by_status(form_opts \\ [])

Creates a form for the by_status action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_reviews_by_user(form_opts \\ [])

Creates a form for the reviewed_by_user action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_search_legislation_title(form_opts \\ [])

Creates a form for the search_title action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_search_offence_description(form_opts \\ [])

Creates a form for the search_description action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_search_offenders(form_opts \\ [])

Creates a form for the search action on EhsEnforcement.Enforcement.Offender.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_skip_match(record, form_opts \\ [])

Creates a form for the skip_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_sync_case_from_airtable(record, form_opts \\ [])

Creates a form for the sync_from_airtable action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_agency(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.Agency.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_case(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_case_from_scraping(record, form_opts \\ [])

Creates a form for the update_from_scraping action on EhsEnforcement.Enforcement.Case.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_enrichment(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_legislation(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.Legislation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_notice(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.Notice.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_offence(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.Offence.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_offender(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.Offender.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_offender_statistics(record, form_opts \\ [])

Creates a form for the update_statistics action on EhsEnforcement.Enforcement.Offender.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

form_to_update_validation(record, form_opts \\ [])

Creates a form for the update action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :actor (term/0) - The actor performing the action. Passed through to the underlying action.
  • :scope (term/0) - A value that implements the Ash.Scope protocol, for passing around actor/tenant/context in a single value. See Ash.Scope for more.
  • :forms (keyword/0) - Nested form configurations. See for_create/3 "Nested Form Options" docs for more.
  • :warn_on_unhandled_errors? (boolean/0) - Warns on any errors that don't match the form pattern of {:field, "message", [replacement: :vars]} or implement the AshPhoenix.FormData.Error protocol. The default value is true.
  • :domain (atom/0) - The domain to use when calling the action.
  • :as (String.t/0) - The name of the form in the submitted params. You will need to pull the form params out using this key. The default value is "form".
  • :id (String.t/0) - The html id of the form. Defaults to the value of :as if provided, otherwise "form"
  • :transform_errors - Allows for manual manipulation and transformation of errors. You may prefer post_process_errors as a simpler API.
    If possible, try to implement AshPhoenix.FormData.Error for the error (if it as a custom one, for example). If that isn't possible, you can provide this function which will get the changeset and the error, and should return a list of ash phoenix formatted errors, e.g [{field :: atom, message :: String.t(), substituations :: Keyword.t()}]
    Example:
    AshPhoenix.Form.for_create(..., transform_errors: fn
      _changeset, %{field: :field1} = error ->
        %{error | field: :field2}  
      _changeset, error ->
        error
    end
  • :post_process_errors - Allows for post-processing of errors after they have been converted to the standard triple format.
    This function receives the form, the path to the form, and an error triple {field, message, vars}. It should return either a modified triple or nil to filter out the error.
    This is useful for:
    • Filtering out certain errors based on custom criteria
    • Remapping field names from one field to another
    • Modifying error messages or variables
      Example:
      AshPhoenix.Form.for_create(..., post_process_errors: fn form, _path, {field, message, vars} ->
      case field do
        :status ->
          # hide these errors
          nil  
        field when field in [:currency, :amount] ->
          # remap the field, and replace the error message
          {:money, "please enter a real money amount", []}  
        field ->
          # leave the others unchanged
          {field, message, vars}
      end
      end)
  • :prepare_source - A 1-argument function the receives the initial changeset (or query) and makes any relevant changes to it. This can be used to do things like:
  • :prepare_params - A 2-argument function that receives the params map and the :validate atom and should return prepared params. Called before the form is validated.
  • :transform_params - A function for post-processing the form parameters before they are used for changeset validation/submission. Use a 3-argument function to pattern match on the AshPhoenix.Form struct.
  • :method (String.t/0) - The http method to associate with the form. Defaults to post for creates, and put for everything else.
  • :exclude_fields_if_empty - These fields will be ignored if they are empty strings.
    This list of fields supports dead view forms. When a form is submitted from dead view empty fields are submitted as empty strings. This is problematic for fields that allow_nil or those that have default values.
  • :tenant (term/0) - The current tenant. Passed through to the underlying action.
  • :params (term/0) - The initial parameters to use for the form. This is useful for setting up a form with default values. The default value is %{}. Any additional options will be passed to the underlying call to build the source, i.e Ash.ActionInput.for_action/4, or Ash.Changeset.for_*. This means you can set things like the tenant/actor. These will be retained, and provided again when Form.submit/3 is called.

Nested Form Options

  • :type - The cardinality of the nested form - :list or :single. Valid values are :list, :single The default value is :single.
  • :sparse? (boolean/0) - If the nested form is sparse, the form won't expect all inputs for all forms to be present.
    Has no effect if the type is :single.
    Normally, if you leave some forms out of a list of nested forms, they are removed from the parameters passed to the action. For example, if you had a post with two comments [%Comment{id: 1}, %Comment{id: 2}] and you passed down params like comments[0][id]=1&comments[1][text]=new_text, we would remove the second comment from the input parameters, resulting in the following being passed into the action: %{"comments" => [%{"id" => 1, "text" => "new"}]}. By setting it to sparse, you have to explicitly use remove_form for that removal to happen. So in the same scenario above, the parameters that would be sent would actually be %{"comments" => [%{"id" => 1, "text" => "new"}, %{"id" => 2}]}.
    One major difference with sparse? is that the form actually ignores the index provided, e.g comments[0]..., and instead uses the primary key e.g comments[0][id] to match which form is being updated. This prevents you from having to find the index of the specific item you want to update. Which could be very gnarly on deeply nested forms. If there is no primary key, or the primary key does not match anything, it is treated as a new form.
    REMEMBER: You need to use Phoenix.Components.inputs_for to render the nested forms, or manually add hidden inputs using hidden_inputs_for (or HiddenInputs if using Surface) for the id to be automatically placed into the form.
  • :forms (keyword/0) - Forms nested inside the current nesting level in all cases.
  • :for_type - What action types the form applies for. Leave blank for it to apply to all action types. Valid values are :read, :create, :update
  • :merge? (boolean/0) - When building parameters, this input will be merged with its parent input. This allows for combining multiple forms into a single input. The default value is false.
  • :for (atom/0) - When creating parameters for the action, the key that the forms should be gathered into. Defaults to the key used to configure the nested form. Ignored if merge? is true.
  • :resource (atom/0) - The resource of the nested forms. Unnecessary if you are providing the data key, and not adding additional forms to this path.
  • :create_action (atom/0) - The create action to use when building new forms. Only necessary if you want to use add_form/3 with this path.
  • :update_action (atom/0) - The update action to use when building forms for data. Only necessary if you supply the data key.
  • :data (term/0) - The current value or values that should have update forms built by default.
    You can also provide a single argument function that will return the data based on the data of the parent form. This is important for multiple nesting levels of :list type forms, because the data depends on which parent is being rendered.

fuzzy_search_cases(search_term, opts \\ [])

Perform fuzzy search across cases using pg_trgm trigram similarity.

This function uses PostgreSQL's pg_trgm extension to find cases with text fields that are similar to the search term, even with typos or partial matches.

Parameters

  • search_term - The text to search for (minimum 3 characters)
  • opts - Additional query options (limit, offset, etc.)

Options

  • :similarity_threshold - Minimum similarity score (0.0-1.0, default: 0.3)
  • :limit - Maximum number of results to return
  • :offset - Number of results to skip
  • :load - Associations to preload

Examples

iex> fuzzy_search_cases("construction", limit: 10)
[%Case{regulator_id: "HSE-2024-123", computed_breaches_summary: "Construction (Design and Management) Regulations 2015"}]

iex> fuzzy_search_cases("acme corp", similarity_threshold: 0.4)
[%Case{offender: %{name: "ACME Construction Ltd"}}]

fuzzy_search_notices(search_term, opts \\ [])

Perform fuzzy search across notices using pg_trgm trigram similarity.

Similar to fuzzy_search_cases/2 but searches notice fields including notice body.

fuzzy_search_offenders(search_term, opts \\ [])

Perform fuzzy search across offenders using pg_trgm trigram similarity.

Searches offender name, normalized name, local authority, and main activity fields.

get(resource, id_or_filter, opts \\ [])

This function is deprecated. Use `Ash.get/3` instead.

get!(resource, id_or_filter, opts \\ [])

This function is deprecated. Use `Ash.get!/3` instead.

get_agency(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Agency.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_agency!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_agency_by_code(code, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Agency.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_agency_by_code!(code, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_case(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Case.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_case!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_current_metrics(params \\ nil, opts \\ nil)

Get the most recent metrics for each time period

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_current_metrics!(params \\ nil, opts \\ nil)

Get the most recent metrics for each time period Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_enrichment(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_enrichment!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_enrichment_by_case(case_id, params \\ nil, opts \\ nil)

Find enrichment for a specific case

Arguments

  • case_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_enrichment_by_case!(case_id, params \\ nil, opts \\ nil)

Find enrichment for a specific case Raises any errors instead of returning them

Arguments

  • case_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_enrichment_by_notice(notice_id, params \\ nil, opts \\ nil)

Find enrichment for a specific notice

Arguments

  • notice_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_enrichment_by_notice!(notice_id, params \\ nil, opts \\ nil)

Find enrichment for a specific notice Raises any errors instead of returning them

Arguments

  • notice_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_legislation(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Legislation.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_legislation!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_legislation_stats()

Get legislation statistics for monitoring duplicate prevention.

get_notice(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Notice.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_notice!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_offence(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offence.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_offence!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_offence_by_reference(offence_reference, params \\ nil, opts \\ nil)

Calls the by_reference action on EhsEnforcement.Enforcement.Offence.

Arguments

  • offence_reference

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_offence_by_reference!(offence_reference, params \\ nil, opts \\ nil)

Calls the by_reference action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Arguments

  • offence_reference

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_offender(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offender.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_offender!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_offender_by_name_and_postcode(name, postcode)

Code Interface Functions

This domain now uses Ash code interfaces. Use the generated functions instead of direct Ash calls:

Agency Functions

Offender Functions

Case Functions

Notice Functions

Metrics Functions

Legislation Functions

Offence Functions (Unified Violation/Breach Support)

get_performance_stats()

Get query performance statistics for monitoring dashboards. This could be extended to track metrics in ETS/database for reporting.

get_review(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_review!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_validation(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_validation!(id, params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

init_cache()

Initialize the cache table. Called during application startup.

list(query, field, opts \\ [])

This function is deprecated. Use `Ash.list/3` instead.

list!(query, field, opts \\ [])

This function is deprecated. Use `Ash.list!/3` instead.

list_agencies(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Agency.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_agencies!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_cases(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Case.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_cases!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_cases_by_date_range(from_date, to_date, params \\ nil, opts \\ nil)

Calls the by_date_range action on EhsEnforcement.Enforcement.Case.

Arguments

  • from_date
  • to_date

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_cases_by_date_range!(from_date, to_date, params \\ nil, opts \\ nil)

Calls the by_date_range action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Arguments

  • from_date
  • to_date

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_cases_with_filters(opts \\ [])

list_cases_with_filters!(opts \\ [])

list_cases_with_filters_cached!(opts \\ [])

Cached version of list_cases_with_filters! for frequently used filter combinations.

Uses a simple cache key based on common filter patterns to avoid repeated database queries. Cache TTL is 300.0 seconds.

list_cases_with_filters_monitored!(opts \\ [])

Monitored version of list_cases_with_filters! that logs slow queries.

list_enrichments(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Enrichment.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_enrichments!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_enrichments_by_model(model_version, params \\ nil, opts \\ nil)

Find enrichments generated by a specific AI model version

Arguments

  • model_version

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_enrichments_by_model!(model_version, params \\ nil, opts \\ nil)

Find enrichments generated by a specific AI model version Raises any errors instead of returning them

Arguments

  • model_version

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_high_confidence_enrichments(params \\ nil, opts \\ nil)

Get enrichments with high confidence scores (all sections > 0.8)

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_high_confidence_enrichments!(params \\ nil, opts \\ nil)

Get enrichments with high confidence scores (all sections > 0.8) Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_high_quality_validations(params \\ nil, opts \\ nil)

Get validations with 4-5 star ratings

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_high_quality_validations!(params \\ nil, opts \\ nil)

Get validations with 4-5 star ratings Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_legislation(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Legislation.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_legislation!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_legislation_by_type(legislation_type, params \\ nil, opts \\ nil)

Calls the by_type action on EhsEnforcement.Enforcement.Legislation.

Arguments

  • legislation_type

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_legislation_by_type!(legislation_type, params \\ nil, opts \\ nil)

Calls the by_type action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Arguments

  • legislation_type

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_legislation_by_year_range(start_year, end_year, params \\ nil, opts \\ nil)

Calls the by_year_range action on EhsEnforcement.Enforcement.Legislation.

Arguments

  • start_year
  • end_year

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_legislation_by_year_range!(start_year, end_year, params \\ nil, opts \\ nil)

Calls the by_year_range action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Arguments

  • start_year
  • end_year

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_legislation_with_filters!(opts \\ [])

list_notices(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Notice.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_notices!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_notices_with_filters!(opts \\ [])

list_notices_with_filters_cached!(opts \\ [])

Cached version of list_notices_with_filters! for frequently used filter combinations.

list_notices_with_filters_monitored!(opts \\ [])

Monitored version of list_notices_with_filters! that logs slow queries.

list_offences(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offence.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_by_case(case_id, params \\ nil, opts \\ nil)

Calls the by_case action on EhsEnforcement.Enforcement.Offence.

Arguments

  • case_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_by_case!(case_id, params \\ nil, opts \\ nil)

Calls the by_case action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Arguments

  • case_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_by_legislation(legislation_id, params \\ nil, opts \\ nil)

Calls the by_legislation action on EhsEnforcement.Enforcement.Offence.

Arguments

  • legislation_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_by_legislation!(legislation_id, params \\ nil, opts \\ nil)

Calls the by_legislation action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Arguments

  • legislation_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_by_notice(notice_id, params \\ nil, opts \\ nil)

Calls the by_notice action on EhsEnforcement.Enforcement.Offence.

Arguments

  • notice_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_by_notice!(notice_id, params \\ nil, opts \\ nil)

Calls the by_notice action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Arguments

  • notice_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_with_fines(params \\ nil, opts \\ nil)

Calls the with_fines action on EhsEnforcement.Enforcement.Offence.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offences_with_fines!(params \\ nil, opts \\ nil)

Calls the with_fines action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offenders(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offender.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offenders!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_offenders_with_filters!(opts \\ [])

list_offenders_with_filters_cached!(opts \\ [])

Cached version of list_offenders_with_filters! for frequently used filter combinations.

list_offenders_with_filters_monitored!(opts \\ [])

Monitored version of list_offenders_with_filters! that logs slow queries.

list_recent_enrichments(params \\ nil, opts \\ nil)

Get recently generated enrichments (last 30 days)

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_recent_enrichments!(params \\ nil, opts \\ nil)

Get recently generated enrichments (last 30 days) Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_recent_validations(params \\ nil, opts \\ nil)

Get recent validations (last 30 days)

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_recent_validations!(params \\ nil, opts \\ nil)

Get recent validations (last 30 days) Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_reviews(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_reviews!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations!(params \\ nil, opts \\ nil)

Calls the read action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_by_enrichment(enrichment_id, params \\ nil, opts \\ nil)

Get all validations for a specific enrichment

Arguments

  • enrichment_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_by_enrichment!(enrichment_id, params \\ nil, opts \\ nil)

Get all validations for a specific enrichment Raises any errors instead of returning them

Arguments

  • enrichment_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_by_section(section, params \\ nil, opts \\ nil)

Get all validations for a specific section type

Arguments

  • section

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_by_section!(section, params \\ nil, opts \\ nil)

Get all validations for a specific section type Raises any errors instead of returning them

Arguments

  • section

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_by_user(user_id, params \\ nil, opts \\ nil)

Get all validations performed by a specific user

Arguments

  • user_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_by_user!(user_id, params \\ nil, opts \\ nil)

Get all validations performed by a specific user Raises any errors instead of returning them

Arguments

  • user_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_needing_attention(params \\ nil, opts \\ nil)

Get validations with low ratings (1-2 stars) that need review

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list_validations_needing_attention!(params \\ nil, opts \\ nil)

Get validations with low ratings (1-2 stars) that need review Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

load(data, query, opts \\ [])

This function is deprecated. Use `Ash.load/3` instead.

load!(data, query, opts \\ [])

This function is deprecated. Use `Ash.load!/3` instead.

max(query, field, opts \\ [])

This function is deprecated. Use `Ash.max/3` instead.

max!(query, field, opts \\ [])

This function is deprecated. Use `Ash.max!/3` instead.

min(query, field, opts \\ [])

This function is deprecated. Use `Ash.min/3` instead.

min!(query, field, opts \\ [])

This function is deprecated. Use `Ash.min!/3` instead.

page(page, request)

This function is deprecated. Use `Ash.page/2` instead.

page!(page, request)

This function is deprecated. Use `Ash.page!/2` instead.

pending_reviews(params \\ nil, opts \\ nil)

Calls the pending_reviews action on EhsEnforcement.Enforcement.OffenderMatchReview.

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

pending_reviews!(params \\ nil, opts \\ nil)

Calls the pending_reviews action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

preview_offender_merge(master_id, duplicate_ids)

Preview what a merge operation would do before executing it.

Validates offender against Companies House and returns preview data showing:

  • Companies House validation results
  • Data that would be applied to master
  • Statistics after merge
  • Records that would be deleted

Parameters

  • master_id - UUID of the offender to keep (master record)
  • duplicate_ids - List of UUIDs of offenders to merge into master

Returns

{:ok, preview_map} with:

  • :validation - %{valid: bool, similarity: float, canonical_name: string, status: string}
  • :companies_house_data - %{name:, address:, town:, county:, postcode:}
  • :merge_preview - %{total_cases:, total_notices:, total_fines:, agencies:, industry_sectors:}
  • :duplicates_info - List of %{id:, name:, location:, cases:, notices:} for records to be deleted

Examples

iex> preview_offender_merge(master_id, [duplicate_id])
{:ok, %{
  validation: %{valid: true, similarity: 1.0, canonical_name: "...", status: "active"},
  companies_house_data: %{name: "...", address: "...", ...},
  merge_preview: %{total_cases: 5, total_notices: 3, total_fines: #Decimal<57000>},
  duplicates_info: [%{id: "...", name: "...", location: "...", cases: 2, notices: 1}]
}}

query_to_get_agency(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_agency_by_code(code, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_case(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_current_metrics(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_enrichment(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_enrichment_by_case(case_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_enrichment_by_notice(notice_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_legislation(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_notice(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_offence(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_offence_by_reference(offence_reference, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_offender(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_review(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_get_validation(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_agencies(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_cases(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_cases_by_date_range(from_date, to_date, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_enrichments(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_enrichments_by_model(model_version, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_high_confidence_enrichments(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_high_quality_validations(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_legislation(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_legislation_by_type(legislation_type, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_legislation_by_year_range(start_year, end_year, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_notices(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_offences(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_offences_by_case(case_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_offences_by_legislation(legislation_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_offences_by_notice(notice_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_offences_with_fines(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_offenders(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_recent_enrichments(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_recent_validations(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_reviews(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_validations(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_validations_by_enrichment(enrichment_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_validations_by_section(section, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_validations_by_user(user_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_list_validations_needing_attention(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_pending_reviews(params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_reviews_by_offender(offender_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_reviews_by_status(status, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_reviews_by_user(user_id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_search_legislation_title(search_term, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_search_offence_description(search_term, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

query_to_search_offenders(query, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.

read(query, opts \\ [])

This function is deprecated. Use `Ash.read/2` instead.

read!(query, opts \\ [])

This function is deprecated. Use `Ash.read!/2` instead.

read_one(query, opts \\ [])

This function is deprecated. Use `Ash.read_one/2` instead.

read_one!(query, opts \\ [])

This function is deprecated. Use `Ash.read_one!/2` instead.

refresh_metrics(params \\ nil, opts \\ nil)

Refresh metrics for a specific filter combination

Inputs

  • total_notices_count - Total number of notices (all time)
  • total_fines_amount - Total fines from cases within the time period
  • recent_activity - Top 100 recent cases/notices matching this filter combination for instant display
  • period_label - Human readable period label (e.g., 'Last 30 Days')
  • recent_notices_count - Number of notices within the time period
  • period - Time period for the metrics (week, month, or year)
  • days_ago - Number of days back from today for the period
  • record_type - Record type filter (NULL = combined cases + notices)
  • cutoff_date - The cutoff date used for recent data filtering
  • legislation_id - Legislation filter for future legislation-specific metrics (currently unused)
  • agency_id - Agency filter (NULL = all agencies combined)
  • agency_stats - Per-agency statistics with enhanced breakdown for dashboard dropdown filtering
  • total_costs_amount - Total costs awarded in cases within the time period
  • total_offences_count - Total number of offences within the time period
  • recent_cases_count - Number of cases within the time period
  • calculated_by - Whether metrics were calculated manually by admin or via automation
  • legislation_breakdown - Top breached legislation with counts (legislation_id => %{title, breach_count, ...})
  • offender_breakdown - Top offenders with statistics (offender_id => %{name, cases, fines, ...})
  • total_cases_count - Total number of cases (all time)
  • active_agencies_count - Number of enabled agencies
  • offender_id - Offender filter for future offender-specific metrics (currently unused)
  • calculated_at - When these metrics were calculated

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

refresh_metrics!(params \\ nil, opts \\ nil)

Refresh metrics for a specific filter combination Raises any errors instead of returning them

Inputs

  • total_notices_count - Total number of notices (all time)
  • total_fines_amount - Total fines from cases within the time period
  • recent_activity - Top 100 recent cases/notices matching this filter combination for instant display
  • period_label - Human readable period label (e.g., 'Last 30 Days')
  • recent_notices_count - Number of notices within the time period
  • period - Time period for the metrics (week, month, or year)
  • days_ago - Number of days back from today for the period
  • record_type - Record type filter (NULL = combined cases + notices)
  • cutoff_date - The cutoff date used for recent data filtering
  • legislation_id - Legislation filter for future legislation-specific metrics (currently unused)
  • agency_id - Agency filter (NULL = all agencies combined)
  • agency_stats - Per-agency statistics with enhanced breakdown for dashboard dropdown filtering
  • total_costs_amount - Total costs awarded in cases within the time period
  • total_offences_count - Total number of offences within the time period
  • recent_cases_count - Number of cases within the time period
  • calculated_by - Whether metrics were calculated manually by admin or via automation
  • legislation_breakdown - Top breached legislation with counts (legislation_id => %{title, breach_count, ...})
  • offender_breakdown - Top offenders with statistics (offender_id => %{name, cases, fines, ...})
  • total_cases_count - Total number of cases (all time)
  • active_agencies_count - Number of enabled agencies
  • offender_id - Offender filter for future offender-specific metrics (currently unused)
  • calculated_at - When these metrics were calculated

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.
  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.
  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided
  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.
  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :changeset (term/0) - A changeset to seed the action with.
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

reload(record, opts \\ [])

This function is deprecated. Use `Ash.reload/2` instead.

reload!(record, opts \\ [])

This function is deprecated. Use `Ash.reload!/2` instead.

reviews_by_offender(offender_id, params \\ nil, opts \\ nil)

Calls the by_offender action on EhsEnforcement.Enforcement.OffenderMatchReview.

Arguments

  • offender_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

reviews_by_offender!(offender_id, params \\ nil, opts \\ nil)

Calls the by_offender action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Arguments

  • offender_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

reviews_by_status(status, params \\ nil, opts \\ nil)

Calls the by_status action on EhsEnforcement.Enforcement.OffenderMatchReview.

Arguments

  • status

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

reviews_by_status!(status, params \\ nil, opts \\ nil)

Calls the by_status action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Arguments

  • status

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

reviews_by_user(user_id, params \\ nil, opts \\ nil)

Calls the reviewed_by_user action on EhsEnforcement.Enforcement.OffenderMatchReview.

Arguments

  • user_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

reviews_by_user!(user_id, params \\ nil, opts \\ nil)

Calls the reviewed_by_user action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Arguments

  • user_id

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

run_action(input, opts \\ [])

This function is deprecated. Use `Ash.run_action/2` instead.

run_action!(input, opts \\ [])

This function is deprecated. Use `Ash.run_action/2` instead.

search_legislation_fuzzy(search_title, similarity_threshold \\ 0.7)

@spec search_legislation_fuzzy(String.t(), float()) ::
  {:ok, [struct()]} | {:error, term()}

Search for existing legislation by title with fuzzy matching.

Useful for manual deduplication or verification.

search_legislation_title(search_term, params \\ nil, opts \\ nil)

Calls the search_title action on EhsEnforcement.Enforcement.Legislation.

Arguments

  • search_term

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

search_legislation_title!(search_term, params \\ nil, opts \\ nil)

Calls the search_title action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Arguments

  • search_term

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

search_offence_description(search_term, params \\ nil, opts \\ nil)

Calls the search_description action on EhsEnforcement.Enforcement.Offence.

Arguments

  • search_term

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

search_offence_description!(search_term, params \\ nil, opts \\ nil)

Calls the search_description action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Arguments

  • search_term

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

search_offenders(query, params \\ nil, opts \\ nil)

Calls the search action on EhsEnforcement.Enforcement.Offender.

Arguments

  • query

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

search_offenders!(query, params \\ nil, opts \\ nil)

Calls the search action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Arguments

  • query

Options

  • :page - Pagination options, see Ash.read/2 for more.
  • :load (term/0) - A load statement to add onto the query
  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
  • :lock (term/0) - A lock statement to add onto the query
  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.
  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :query - A query to seed the action with.
  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.
  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.
  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given
    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

skip_match(record, reviewed_by_id, params \\ nil, opts \\ nil)

Calls the skip_match action on EhsEnforcement.Enforcement.OffenderMatchReview.

Arguments

  • reviewed_by_id

Inputs

  • review_notes - Optional notes from admin about the review decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

skip_match!(record, reviewed_by_id, params \\ nil, opts \\ nil)

Calls the skip_match action on EhsEnforcement.Enforcement.OffenderMatchReview. Raises any errors instead of returning them

Arguments

  • reviewed_by_id

Inputs

  • review_notes - Optional notes from admin about the review decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

stream!(query, opts \\ [])

This function is deprecated. Use `Ash.stream!/2` instead.

sum(query, field, opts \\ [])

This function is deprecated. Use `Ash.sum/3` instead.

sum!(query, field, opts \\ [])

This function is deprecated. Use `Ash.sum!/3` instead.

sync_and_merge_offenders(master_id, duplicate_ids)

Execute the merge operation to combine duplicate offenders.

Calls the sync_and_merge_duplicates Ash action on the master record.

Parameters

  • master_id - UUID of the offender to keep
  • duplicate_ids - List of UUIDs of offenders to merge and delete

Returns

  • {:ok, merged_offender} - Successfully merged offender with updated data
  • {:error, reason} - Merge failed (transaction rolled back)

Examples

iex> sync_and_merge_offenders(master_id, [duplicate_id1, duplicate_id2])
{:ok, %Offender{name: "WRG WASTE SERVICES LIMITED", total_cases: 5, ...}}

sync_case_from_airtable(record, params \\ nil, opts \\ nil)

Calls the sync_from_airtable action on EhsEnforcement.Enforcement.Case.

Inputs

  • url
  • offence_hearing_date
  • offence_result
  • offence_fine
  • offence_costs
  • related_cases

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

sync_case_from_airtable!(record, params \\ nil, opts \\ nil)

Calls the sync_from_airtable action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Inputs

  • url
  • offence_hearing_date
  • offence_result
  • offence_fine
  • offence_costs
  • related_cases

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update(changeset, opts \\ [])

This function is deprecated. Use `Ash.update/2` instead.

update!(changeset, opts \\ [])

This function is deprecated. Use `Ash.update!/2` instead.

update_agency(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Agency.

Inputs

  • enabled
  • name
  • base_url

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_agency!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Agency. Raises any errors instead of returning them

Inputs

  • enabled
  • name
  • base_url

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_case(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Case.

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_case!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_case_from_scraping(record, params \\ nil, opts \\ nil)

Calls the update_from_scraping action on EhsEnforcement.Enforcement.Case.

Inputs

  • url
  • offence_hearing_date
  • offence_result
  • offence_fine
  • offence_costs
  • related_cases

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_case_from_scraping!(record, params \\ nil, opts \\ nil)

Calls the update_from_scraping action on EhsEnforcement.Enforcement.Case. Raises any errors instead of returning them

Inputs

  • url
  • offence_hearing_date
  • offence_result
  • offence_fine
  • offence_costs
  • related_cases

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_enrichment(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Enrichment.

Inputs

  • regulation_links - AI-identified regulation references extracted from breach descriptions. Each entry contains: {act, section, relevance_score, summary}
  • benchmark_analysis - Industry benchmark comparisons.
  • For Cases: fine amount percentiles, average fines for similar violations
  • For Notices: compliance timelines, notice escalation patterns
  • confidence_scores - Confidence scores (0.0-1.0) for each AI-generated section: {regulation_links: 0.95, benchmark_accuracy: 0.87, pattern_detection: 0.82, ...}
  • pattern_detection - Historical pattern analysis including:
  • Similar cases/notices count
  • Trend analysis (increasing/decreasing enforcement)
  • Notable precedents
  • Repeat offender patterns
  • layperson_summary - Plain language summary (Grade 8-10 reading level) for non-technical users
  • professional_summary - Technical summary for compliance officers and legal professionals
  • auto_tags - AI-generated categorization tags (e.g., 'construction', 'fatal-accident', 'repeat-offender')

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_enrichment!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Enrichment. Raises any errors instead of returning them

Inputs

  • regulation_links - AI-identified regulation references extracted from breach descriptions. Each entry contains: {act, section, relevance_score, summary}
  • benchmark_analysis - Industry benchmark comparisons.
  • For Cases: fine amount percentiles, average fines for similar violations
  • For Notices: compliance timelines, notice escalation patterns
  • confidence_scores - Confidence scores (0.0-1.0) for each AI-generated section: {regulation_links: 0.95, benchmark_accuracy: 0.87, pattern_detection: 0.82, ...}
  • pattern_detection - Historical pattern analysis including:
  • Similar cases/notices count
  • Trend analysis (increasing/decreasing enforcement)
  • Notable precedents
  • Repeat offender patterns
  • layperson_summary - Plain language summary (Grade 8-10 reading level) for non-technical users
  • professional_summary - Technical summary for compliance officers and legal professionals
  • auto_tags - AI-generated categorization tags (e.g., 'construction', 'fatal-accident', 'repeat-offender')

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_legislation(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Legislation.

Inputs

  • legislation_title - Full title of the legislation (e.g., 'Health and Safety at Work etc. Act')
  • legislation_type - Type of legislation
  • legislation_year - Year the legislation was enacted (e.g., 1974)
  • legislation_number - Official number/chapter of the legislation (e.g., 33)

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_legislation!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Legislation. Raises any errors instead of returning them

Inputs

  • legislation_title - Full title of the legislation (e.g., 'Health and Safety at Work etc. Act')
  • legislation_type - Type of legislation
  • legislation_year - Year the legislation was enacted (e.g., 1974)
  • legislation_number - Official number/chapter of the legislation (e.g., 33)

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_notice(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Notice.

Inputs

  • notice_body
  • airtable_id
  • last_synced_at
  • environmental_receptor
  • operative_date
  • offence_action_type
  • regulator_id
  • legal_section
  • notice_date
  • offence_breaches - Description of regulation breaches/violations
  • environmental_impact
  • legal_act
  • url
  • regulator_event_reference
  • offence_action_date
  • regulator_function
  • compliance_date
  • regulator_ref_number

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_notice!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Notice. Raises any errors instead of returning them

Inputs

  • notice_body
  • airtable_id
  • last_synced_at
  • environmental_receptor
  • operative_date
  • offence_action_type
  • regulator_id
  • legal_section
  • notice_date
  • offence_breaches - Description of regulation breaches/violations
  • environmental_impact
  • legal_act
  • url
  • regulator_event_reference
  • offence_action_date
  • regulator_function
  • compliance_date
  • regulator_ref_number

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_offence(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Offence.

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_offence!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Offence. Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_offender(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Offender.

Inputs

  • name
  • address
  • local_authority
  • main_activity
  • industry
  • business_type
  • agencies
  • sic_code
  • country

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_offender!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Inputs

  • name
  • address
  • local_authority
  • main_activity
  • industry
  • business_type
  • agencies
  • sic_code
  • country

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_offender_statistics(record, params \\ nil, opts \\ nil)

Calls the update_statistics action on EhsEnforcement.Enforcement.Offender.

Inputs

  • fine_amount

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_offender_statistics!(record, params \\ nil, opts \\ nil)

Calls the update_statistics action on EhsEnforcement.Enforcement.Offender. Raises any errors instead of returning them

Inputs

  • fine_amount

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_validation(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.EnrichmentValidation.

Inputs

  • rating - Accuracy rating (1-5 stars)
  • corrections - Optional correction suggestions or detailed feedback from professional
  • validation_notes - Internal notes about validation context (e.g., 'Validated during QA review')

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

update_validation!(record, params \\ nil, opts \\ nil)

Calls the update action on EhsEnforcement.Enforcement.EnrichmentValidation. Raises any errors instead of returning them

Inputs

  • rating - Accuracy rating (1-5 stars)
  • corrections - Optional correction suggestions or detailed feedback from professional
  • validation_notes - Internal notes about validation context (e.g., 'Validated during QA review')

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.
  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.
  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.
  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.
  • :action (term/0) - The action to use, either an Action struct or the name of the action
  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.
  • :context (map/0) - Context to set on the query, changeset, or input
  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset
  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access
  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.
  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.
  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.
  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.
  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.
  • :load (term/0) - A load statement to add onto the changeset
  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.
    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.
    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.
    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.
    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].
    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.
    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.
    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2
    • :lock (term/0) - A lock statement to add onto the query
    • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element. The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.
    • :reuse_values? (boolean/0) - Whether calculations are allowed to reuse values that have already been loaded, or must refetch them from the data layer. The default value is false.
    • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching. See Ash.Query.load/2. The default value is false.
    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.
    • :read_action (atom/0) - The action to use when building the read query.
    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.
    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.
    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.
    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.
    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.
    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.
    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.
    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is false.
    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.
    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned. Potential elements: {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error. The default value is false.
    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing. Only relevant if return_stream? is set to true and all other return_*? options are set to false. The default value is false.
    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is false.
    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions. Notifications will be automatically sent unless return_notifications? is set to true. The default value is false.
    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all. Keep in mind: before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all. The default value is :batch.
    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.
  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.